1 <?php
2  session_start();
3  
if(isset($_SESSION['user']))
4  {
5
6  }
7  
else{
8   echo
"<script>location.href='login.html'</script>";
9  }
10 ?>
11 <html>
12     <head>
13         <title>Customer </title>
14         <style>
15             body {
16   margin:
0;
17   font-family: Arial, Helvetica, sans-serif;
18   background: #
484848;
19 }
20 .topnav {
21   overflow: hidden;
22   background-color:#8d2663;
23   height: 70px;
24   border: 3px solid #b40a70;
25 }
26
27 .topnav a {
28   
float: left;
29   color: #f2f2f2;
30   text-align: center;
31   padding: 14px 16px;
32   text-decoration: none;
33   font-size: 35px;
34   font-weight: bold;
35 }
36
37 .topnav-right {
38   
float: right;
39 }
40 table {
41     font-family: arial, sans-serif;
42     border-collapse: collapse;
43     outline:#b40a70 solid 5px;
44     width:
100%;
45     margin:5px ;
46     background: #FAFAFA;
47 }
48
49 td, th {
50     border: 1px solid #dddddd;
51     text-align: left;
52     padding: 8px;
53 }
54 th{
55   background-color:#8d2663;
56 }
57
58
59
60 .custombutton{
61   margin:25px;
62   
63 }input[type=text] {
64     width:
15%;
65     padding: 12px 20px;
66     margin:8px ;
67     border: 2px solid red;
68     background:transparent;
69     color:#
000000;
70 }
71
72
73 </style>
74 </head>
75 <body>
76 <div
class="topnav">
77             <a
class="active" href="home.html"><img src="ic_add_pet.png"></a>
78             <a href=
"customer.php">Customers</a>
79             <div
class="topnav-right">
80               <a href=
"logout.php">logout</a>
81             </div>
82           </div>
83           <div
class="custombutton">
84 <form>
85 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
86 border: 3px solid #b40a70;background-color: #8d2663;color:#f2f2f2;font-size:15px;"
formaction="customeradd.php">Add new customer</button>
87 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
88 border: 3px solid #b40a70;background-color: #8d2663;color:#f2f2f2;font-size:15px;"
formaction="customerupdate.php">update customer</button>
89 <button style=
"margin-left:500px; height: 50px;width: 150px;cursor:pointer;border-radius:15px;
90 border: 3px solid #b40a70;background-color: #8d2663;color:#f2f2f2;font-size:15px;"
formaction="phone.php">phone nos.</button>
91 </form>
92 </div>
93     <?php
94    
95 $con = mysqli_connect(
"localhost","root","","Petshop_management");//change username and password according to your server settings
96 if
(!$con)
97 {
98 die(
"could not connect".mysql_error());
99 }
100 $
var=mysqli_query($con,"select * from customer ");
101 echo
"<table>";
102 echo
"<tr>
103 <th>cs_ID</th>
104 <th>cs_fname</th>
105 <th>cs_minit</th>
106 <th>cs_lname</th>
107 <th>cs_address</th>
108 </tr>"
;
109 if
(mysqli_num_rows($var)>0){
110     
while($arr=mysqli_fetch_row($var))
111     { echo
"<tr>
112     <td>$arr[
0]</td>
113     <td>$arr[
1]</td>
114     <td>$arr[
2]</td>
115     <td>$arr[
3]</td>
116     <td>$arr[
4]</td>
117     </tr>"
;}
118     echo
"</table>";
119     mysqli_free_result($
var);
120 }
121
122 mysqli_close($con);
123     
124     
125 ?>
126 <form action=
"deletecustomer.php" method="post">
127 <input id=
"dbutton" type="text" name="t1" placeholder="Enter the id to delete" required>
128     <input style=
"width:75px;height:44px;cursor:pointer;border-radius:15px;
129 border: 3px solid #b40a70;background-color: #8d2663;color:#f2f2f2;font-size:15px;"
type="submit" value="Delete">
130 </form>
131
132 </body>
133 </html>


Gõ tìm kiếm nhanh...